<!DOCTYPE HTML>
<html lang="Chinese">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="移动端基础, 博客">
    <meta name="description" content="In me the tiger sniffs the rose.">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>移动端基础 | 凡诚</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">
    <script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>
    <script src="/libs/jquery/jquery.min.js"></script>

<meta name="generator" content="Hexo 5.4.2"></head>



   <style>
    body{
       background-image: url(https://cdn.jsdelivr.net/gh/Tokisaki-Galaxy/res/site/medias/background.jpg);
       background-repeat:no-repeat;
       background-size:cover;
       background-attachment:fixed;
    }
</style>



<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/comment_bg.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">凡诚</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>主页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>文章</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="" class="waves-effect waves-light">

      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于我</span>
      <i class="fas fa-chevron-down" aria-hidden="true" style="zoom: 0.6;"></i>
    </a>
    <ul class="sub-nav menus_item_child ">
      
      <li>
        <a href="/about">
          
          <i class="fas fa-user-circle" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>我的信息</span>
        </a>
      </li>
      
      <li>
        <a href="/contact">
          
          <i class="fas fa-comments" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>留言板</span>
        </a>
      </li>
      
      <li>
        <a href="/friends">
          
          <i class="fas fa-address-book" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>友链</span>
        </a>
      </li>
      
    </ul>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="Search" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/comment_bg.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">凡诚</div>
        <div class="logo-desc">
            
            In me the tiger sniffs the rose.
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			主页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			文章
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="javascript:;">
			
				<i class="fa-fw fas fa-user-circle"></i>
			
			关于我
			<span class="m-icon"><i class="fas fa-chevron-right"></i></span>
		</a>
            <ul  style="background:  ;" >
              
                <li>

                  <a href="/about " style="margin-left:75px">
				  
				   <i class="fa fas fa-user-circle" style="position: absolute;left:50px" ></i>
			      
		          <span>我的信息</span>
                  </a>
                </li>
              
                <li>

                  <a href="/contact " style="margin-left:75px">
				  
				   <i class="fa fas fa-comments" style="position: absolute;left:50px" ></i>
			      
		          <span>留言板</span>
                  </a>
                </li>
              
                <li>

                  <a href="/friends " style="margin-left:75px">
				  
				   <i class="fa fas fa-address-book" style="position: absolute;left:50px" ></i>
			      
		          <span>友链</span>
                  </a>
                </li>
              
            </ul>
          
        </li>
        
        
    </ul>
</div>


        </div>

        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/8.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">移动端基础</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/html/">
                                <span class="chip bg-color">html</span>
                            </a>
                        
                            <a href="/tags/%E7%A7%BB%E5%8A%A8%E7%AB%AF/">
                                <span class="chip bg-color">移动端</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/%E5%89%8D%E7%AB%AF%E6%8A%80%E6%9C%AF/" class="post-category">
                                前端技术
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>Publish Date:&nbsp;&nbsp;
                    2021-11-08
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>Update Date:&nbsp;&nbsp;
                    2022-11-08
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>Word Count:&nbsp;&nbsp;
                    6.9k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>Read Times:&nbsp;&nbsp;
                    27 Min
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>Read Count:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/libs/prism/prism.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h1 id="移动端基础"><a href="#移动端基础" class="headerlink" title="移动端基础"></a>移动端基础</h1><h2 id="一-移动端基础"><a href="#一-移动端基础" class="headerlink" title="一. 移动端基础"></a>一. 移动端基础</h2><blockquote>
<ul>
<li>移动端浏览器主要针对webkit内核进行兼容。</li>
<li>开发的移动端主要针对手机端的开发。</li>
<li>移动端碎片化严重，分辨率和屏幕尺寸大小不一样。</li>
<li>可以使用浏览器模拟手机界面进行调试。</li>
</ul>
</blockquote>
<h2 id="二-视口"><a href="#二-视口" class="headerlink" title="二. 视口"></a>二. 视口</h2><blockquote>
<p>视口就是浏览器显示页面内容的屏幕区域，视口可以分为：布局视口，视觉视口，理想视口。</p>
</blockquote>
<h3 id="2-1-布局视口-layout-vierport"><a href="#2-1-布局视口-layout-vierport" class="headerlink" title="2.1 布局视口  layout vierport"></a>2.1 布局视口  layout vierport</h3><blockquote>
<ul>
<li>一般移动设备的浏览器都默认设置了一个布局视口，用于解决早期的pc端页面再手机上显示的问题。</li>
<li>ios,Android基本都将这个视口分辨率设置为980px，所以pc端的网页大多数都可以在手机上显示，只不过元素看上去很小，一般默认可以通过手动缩放网页。</li>
</ul>
</blockquote>
<p><img src="https://www.hualigs.cn/image/6086b0018291e.jpg"></p>
<h3 id="2-2-视觉视口-visual-viewport"><a href="#2-2-视觉视口-visual-viewport" class="headerlink" title="2.2 视觉视口  visual viewport"></a>2.2 视觉视口  visual viewport</h3><blockquote>
<ul>
<li>字面意思，是用户正在看到的网站的区域。  注意：<code>是网站的区域。</code></li>
<li>可以通过缩放去操作视觉视口，但是不会影响布局视口，布局视口仍保持原来的宽度。</li>
</ul>
</blockquote>
<p><img src="https://www.hualigs.cn/image/6086b06d46743.jpg"></p>
<h3 id="2-3-理想视口-ideal-viewport"><a href="#2-3-理想视口-ideal-viewport" class="headerlink" title="2.3 理想视口 ideal viewport"></a>2.3 理想视口 ideal viewport</h3><blockquote>
<ul>
<li>为了使网站在移动端有最理想的浏览和阅读宽度而设定。</li>
<li>理想视口。对于设备来说，使最理想的视口尺寸。</li>
<li>需要手动添加meta视口标签通知浏览器操作。</li>
<li>meta视口标签的主要目的：布局视口的宽度应该和理想视口的宽度一致，简单理解就是设备有多宽，布局的视口就有多宽。</li>
</ul>
</blockquote>
<h3 id="2-4-视口的meta标签设置"><a href="#2-4-视口的meta标签设置" class="headerlink" title="2.4 视口的meta标签设置"></a>2.4 视口的meta标签设置</h3><blockquote>
<ul>
<li>视口宽的和设备保持一致。</li>
<li>是扣的默认缩放比例为1.0。</li>
<li>不允许用户自行缩放。</li>
<li>最大允许的缩放比例为1.0。</li>
<li>最小允许的缩放比例为1.0。</li>
</ul>
</blockquote>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup">
	<span class="token comment">&lt;!--设置宽度=理想宽度，不允许用户缩放，初始缩放=1.0，最大缩放=1.0，最小缩放=1.0--></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>viewport<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>width=device-width ,user-scalable=no,initial-scale=1.0,maxumun-scale=1.0,minmum-scale=1.0<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>

<table>
<thead>
<tr>
<th>属性</th>
<th>说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>width</td>
<td>宽度设置的是viewport宽度，可以设置device-width特殊值。(理想视口）</td>
<td></td>
</tr>
<tr>
<td>initial-scale</td>
<td>初始缩放比。大于0的数字。</td>
<td></td>
</tr>
<tr>
<td>maximum-scale</td>
<td>最大缩放比，大于0的数字。</td>
<td></td>
</tr>
<tr>
<td>minimum-scale</td>
<td>最小缩放比，大于0的数字。</td>
<td></td>
</tr>
<tr>
<td>user-scalable</td>
<td>用户是否可以缩放。yes或者no(1,0)</td>
<td></td>
</tr>
</tbody></table>
<h2 id="三-二倍图"><a href="#三-二倍图" class="headerlink" title="三. 二倍图"></a>三. 二倍图</h2><h3 id="3-1-物理像素-amp-物理像素比"><a href="#3-1-物理像素-amp-物理像素比" class="headerlink" title="3.1 物理像素&amp;物理像素比"></a>3.1 物理像素&amp;物理像素比</h3><blockquote>
<ul>
<li>物理像素点指的是屏幕现实的最小颗粒。是物理真实存在的。</li>
<li>物理像素就时分辨率。</li>
<li>开发时的1px不是一定等于1个物理像素的</li>
<li>pc端页面，<code>1个px等于1个物理像素，</code>（待考证）但是移动端就不尽相同。</li>
<li>一个px的能显示的物理像素点的个数，称为物理像素比或者屏幕像素比。</li>
</ul>
</blockquote>
<h3 id="3-2-多倍图"><a href="#3-2-多倍图" class="headerlink" title="3.2 多倍图"></a>3.2 多倍图</h3><blockquote>
<ul>
<li>对于一张50px*50px的图片，在手机Retina屏中打开，按照物理像素比会放大倍数，造成图片的模糊。</li>
<li>在标准的viewport设置中，使用倍图来提高图片的质量，解决在高清设备中的模糊问题。</li>
<li>通常使用二倍图，因为苹果手机的影响，现在还存在3.4倍图的情况。</li>
<li>背景图片注意缩放问题。</li>
</ul>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">img</span> <span class="token punctuation">&#123;</span>
    <span class="token comment">/*原始图片100px*100px*/</span>
    width： 50px；
    height： 50px；
<span class="token punctuation">&#125;</span>
<span class="token selector">.box</span> <span class="token punctuation">&#123;</span>
    <span class="token comment">/*原始图片100px*100px*/</span>
    <span class="token property">background-size</span><span class="token punctuation">:</span>50px 50px<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>





<h2 id="四-移动端开发选择"><a href="#四-移动端开发选择" class="headerlink" title="四.移动端开发选择"></a>四.移动端开发选择</h2><h3 id="4-1-单独移动端页面-主流"><a href="#4-1-单独移动端页面-主流" class="headerlink" title="4.1 单独移动端页面(主流)"></a>4.1 单独移动端页面(主流)</h3><blockquote>
<p>通常情况下，网址域名前面加m(mobile)可以打开移动端，通过判断设备，如果是移动端打开网页，则会跳转到移动端。</p>
</blockquote>
<h3 id="4-2-响应式兼容pc移动端"><a href="#4-2-响应式兼容pc移动端" class="headerlink" title="4.2 响应式兼容pc移动端"></a>4.2 响应式兼容pc移动端</h3><blockquote>
<p>通过判断屏幕宽度来改变样式，以适应不同的终端。</p>
<p>缺点：制作麻烦，需要话得很大的精力去调整兼容性问题。</p>
</blockquote>
<h2 id="五-移动端技术解决方案"><a href="#五-移动端技术解决方案" class="headerlink" title="五.移动端技术解决方案"></a>五.移动端技术解决方案</h2><h3 id="5-1-移动端浏览器"><a href="#5-1-移动端浏览器" class="headerlink" title="5.1 移动端浏览器"></a>5.1 移动端浏览器</h3><blockquote>
<p>移动端浏览器基本以webkit内核为主，主要考虑webkit兼容问题。</p>
<p>可以使用h5标签和css3标签样式。</p>
<p>浏览器的私有前缀只需要 考虑添加webkit即可。</p>
</blockquote>
<p><img src="https://www.hualigs.cn/image/609748fd6653c.jpg"></p>
<h3 id="5-2-css初始化-normalize-css"><a href="#5-2-css初始化-normalize-css" class="headerlink" title="5.2 css初始化 normalize.css"></a>5.2 css初始化 normalize.css</h3><blockquote>
<p>移动端css初始化推荐使用 normalize.css。</p>
<ul>
<li><p>保护课有价值的默认值。</p>
</li>
<li><p>修复了浏览器的bug。</p>
</li>
<li><p>是模块化的。</p>
</li>
<li><p>拥有详细的文档。 </p>
<p><a target="_blank" rel="noopener" href="https://necolas.github.io/normalize.css/">官方地址</a></p>
</li>
</ul>
</blockquote>
<p><img src="https://www.hualigs.cn/image/60974a45db475.jpg"></p>
<h3 id="5-3-css3盒子模型-box-sizing"><a href="#5-3-css3盒子模型-box-sizing" class="headerlink" title="5.3 css3盒子模型 box-sizing"></a>5.3 css3盒子模型 box-sizing</h3><blockquote>
<ul>
<li><p>传统的模式宽度计算：</p>
<p>​        盒子宽度=css中设置的width + border + padding</p>
</li>
<li><p>css3新盒子模型：</p>
<p>​        盒子宽度 = =css中设置的width，其中包含了border 和 padding，使用新的盒子模型，padding和border不会撑大盒子了。</p>
</li>
</ul>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token comment">/*css3盒子模型*/</span>
box-sizing：border-box；
<span class="token comment">/*传统的盒子模型*/</span>
<span class="token property">box-sizing</span><span class="token punctuation">:</span>  content-box<span class="token punctuation">;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>





<h3 id="5-4-特殊样式"><a href="#5-4-特殊样式" class="headerlink" title="5.4 特殊样式"></a>5.4 特殊样式</h3><pre class="line-numbers language-css" data-language="css"><code class="language-css">
<span class="token comment">/*css3盒子模型*/</span>
box-sizing：border-box；
<span class="token property">-webkit-box-sizing</span><span class="token punctuation">:</span> border-box<span class="token punctuation">;</span>

<span class="token comment">/*点击超链接高亮，需要清除设置为transparent 完全透明*/</span>
-webkit-tap-heighlight-color：  transparent；

<span class="token comment">/*在移动端浏览器默认的外观在ios上加上此属性才能给按钮和输入框自定义样式*/</span>
-webkit-appearance：none；

<span class="token comment">/*设置长按页面时弹出菜单，主要设置图片和超链接*/</span>
<span class="token selector">img，a</span><span class="token punctuation">&#123;</span>
    <span class="token property">-webkiy-touch-callout</span><span class="token punctuation">:</span>none<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h2 id="六，移动端常见布局"><a href="#六，移动端常见布局" class="headerlink" title="六，移动端常见布局"></a>六，移动端常见布局</h2><blockquote>
<p>移动端布局和pc端布局有所区别</p>
<p>先选择开发技术选型   -》  再选择布局方式</p>
</blockquote>
<h3 id="1-单独制作移动端页面"><a href="#1-单独制作移动端页面" class="headerlink" title="1.单独制作移动端页面"></a>1.单独制作移动端页面</h3><blockquote>
<ul>
<li>流式布局(百分比布局)</li>
<li>flex弹性布局(较好)</li>
<li>less+rem+媒体查询布局</li>
<li>混合布局</li>
</ul>
</blockquote>
<h3 id="2-响应式页面兼容移动端"><a href="#2-响应式页面兼容移动端" class="headerlink" title="2.响应式页面兼容移动端"></a>2.响应式页面兼容移动端</h3><blockquote>
<ul>
<li>媒体查询</li>
<li>bootstrap</li>
</ul>
</blockquote>
<h3 id="流式布局"><a href="#流式布局" class="headerlink" title="流式布局"></a>流式布局</h3><blockquote>
<ul>
<li>流式布局，就是百分比布局，也称为非固定像素布局。</li>
<li>通过盒子的宽度设置成百分比来根据屏幕的宽度来进行伸缩，不受固定像素的限制，内容向两侧填充。</li>
<li>流式布局方式时移动web开发使用比较常见的布局方式。</li>
<li>max-width 最大宽度(max-height 最大高度)</li>
<li>min-width  最小宽度(min-height 最小高度)</li>
</ul>
</blockquote>
<p>常用初始化样式：</p>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">body</span> <span class="token punctuation">&#123;</span>
    <span class="token property">width</span><span class="token punctuation">:</span> 100%<span class="token punctuation">;</span>  <span class="token comment">/*流式布局*/</span>
    <span class="token property">min-width</span><span class="token punctuation">:</span> 320px<span class="token punctuation">;</span>   <span class="token comment">/*设置最小宽度*/</span>
    <span class="token property">max-width</span><span class="token punctuation">:</span> 640px<span class="token punctuation">;</span>   <span class="token comment">/*设置最大宽度*/</span>
    <span class="token property">margin</span><span class="token punctuation">:</span> 0 auto<span class="token punctuation">;</span>      <span class="token comment">/*设置居中*/</span>
    <span class="token property">font-size</span><span class="token punctuation">:</span> 14px<span class="token punctuation">;</span>     <span class="token comment">/*设置字号*/</span>
    <span class="token property">font-family</span><span class="token punctuation">:</span> -apple-system<span class="token punctuation">,</span>Helvetica<span class="token punctuation">,</span>sans-serif<span class="token punctuation">;</span>  <span class="token comment">/*设置字号*/</span>
    <span class="token property">color</span><span class="token punctuation">:</span> #666<span class="token punctuation">;</span>
    <span class="token property">line-height</span><span class="token punctuation">:</span> 1.5<span class="token punctuation">;</span>   <span class="token comment">/*行高*/</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h3 id="flex弹性布局"><a href="#flex弹性布局" class="headerlink" title="flex弹性布局"></a>flex弹性布局</h3><blockquote>
<ul>
<li>操作方便，布局极为简单，移动端应用很广泛。</li>
<li>pc端浏览器支持情况较差。</li>
<li>IE11或低版本不支持或仅部分支持。</li>
<li>使用<code>display:flex；</code></li>
</ul>
</blockquote>
<h4 id="flex原理"><a href="#flex原理" class="headerlink" title="flex原理"></a>flex原理</h4><blockquote>
<p>flex意为弹性布局，为盒状模型提供最大的灵活性，任何一个容器都可以指定为flex布局。</p>
<p>采用flex布局的元素，称为flex容器，简称容器，他的所有子元素自动成为容器的成员，称为flex项目，简称”项目”。</p>
<p>通过对符合子添加flex属性，来控制子盒子的位置和排列方式</p>
<p>子容器可以横向排列也可以纵向排列。</p>
<ul>
<li>当为父盒子设为flex布局以后，子元素的float,clear和vertical-align属性将会失效。</li>
<li>伸缩布局 = 弹性布局 = 伸缩盒子布局 = 弹性盒布局 = flex布局</li>
</ul>
</blockquote>
<h4 id="flex常见的父项属性"><a href="#flex常见的父项属性" class="headerlink" title="flex常见的父项属性"></a>flex常见的父项属性</h4><blockquote>
<p>以下6个属性是对父元素设置的：</p>
</blockquote>
<table>
<thead>
<tr>
<th>属性</th>
<th>说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>flex-direction</td>
<td>设置主轴的方向</td>
<td></td>
</tr>
<tr>
<td>justify-content</td>
<td>设置主轴上的子元素的排列顺序</td>
<td></td>
</tr>
<tr>
<td>flex-wrap</td>
<td>设置子元素是否换行</td>
<td></td>
</tr>
<tr>
<td>align-content</td>
<td>设置侧轴上的子元素的排列方式(多行)</td>
<td></td>
</tr>
<tr>
<td>align-items</td>
<td>设置侧轴上的子元素排列方式(单行)</td>
<td></td>
</tr>
<tr>
<td>flex-flow</td>
<td>复合属性，相当于同时设置了flex-direction和flex-wrap</td>
<td></td>
</tr>
</tbody></table>
<h4 id="flex-direction设置主轴方向"><a href="#flex-direction设置主轴方向" class="headerlink" title="flex-direction设置主轴方向"></a>flex-direction设置主轴方向</h4><h5 id="主轴和侧轴的方向"><a href="#主轴和侧轴的方向" class="headerlink" title="主轴和侧轴的方向"></a>主轴和侧轴的方向</h5><blockquote>
<p>在flex布局中，分为主轴和侧轴两个方向，还可以叫做行和列，X和Y轴</p>
<ul>
<li>默认主轴方向就是X轴方向，水平向右。</li>
<li>默认侧轴方向就是Y轴方向，水平向下。</li>
</ul>
<p>元素是按照主轴的方向排列的，可以设置主轴的方向，剩下的就是侧轴。</p>
</blockquote>
<table>
<thead>
<tr>
<th>属性值</th>
<th>说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>row</td>
<td>从左到右</td>
<td>默认值</td>
</tr>
<tr>
<td>row-reverse</td>
<td>从右到左</td>
<td></td>
</tr>
<tr>
<td>column</td>
<td>从上到下</td>
<td></td>
</tr>
<tr>
<td>column-reverse</td>
<td>从下到上</td>
<td></td>
</tr>
</tbody></table>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">父盒子</span> <span class="token punctuation">&#123;</span>
    <span class="token property">flex-direction</span><span class="token punctuation">:</span> row-reverse<span class="token punctuation">;</span>     //设置为从右到左排列
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>





<h4 id="justify-content-设置主轴上的子元素排列顺序"><a href="#justify-content-设置主轴上的子元素排列顺序" class="headerlink" title="justify-content 设置主轴上的子元素排列顺序"></a>justify-content 设置主轴上的子元素排列顺序</h4><blockquote>
<p>justify-content属性定义了项目在主轴上的对齐方式。</p>
<p>注：  使用此属性时一定要确定好主轴的方向。</p>
</blockquote>
<table>
<thead>
<tr>
<th>属性</th>
<th>说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>flex-start</td>
<td>从头部开始，如果主轴时X轴这从左到右</td>
<td>默认值</td>
</tr>
<tr>
<td>flex-end</td>
<td>从尾部开始排列</td>
<td></td>
</tr>
<tr>
<td>center</td>
<td>从主轴居中对齐，如果主轴是X轴则水平对齐</td>
<td></td>
</tr>
<tr>
<td>space-around</td>
<td>平分剩余空间</td>
<td></td>
</tr>
<tr>
<td>space-between</td>
<td>先两边贴边，在平分剩余空间</td>
<td>常用</td>
</tr>
</tbody></table>
<h4 id="flew-warp设置子元素是否换行"><a href="#flew-warp设置子元素是否换行" class="headerlink" title="flew-warp设置子元素是否换行"></a>flew-warp设置子元素是否换行</h4><blockquote>
<p>默认情况下，项目都排在一条线(又称”轴线”)上。flex-wrap属性定义，flex布局中默认是不换行的。</p>
</blockquote>
<table>
<thead>
<tr>
<th>属性值</th>
<th>说明</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>nowrap</td>
<td>默认值不换行</td>
<td></td>
</tr>
<tr>
<td>wrap</td>
<td>换行</td>
<td></td>
</tr>
</tbody></table>
<h4 id="align-items（单行）"><a href="#align-items（单行）" class="headerlink" title="align-items（单行）"></a>align-items（单行）</h4><blockquote>
<p>该属性是控制子项在侧轴(默认是Y轴)上的排列方式在子项为单项的时候使用。</p>
</blockquote>
<table>
<thead>
<tr>
<th>属性值</th>
<th>说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>flex-start</td>
<td>从上到下</td>
<td></td>
</tr>
<tr>
<td>flex-end</td>
<td>从下到上</td>
<td></td>
</tr>
<tr>
<td>center</td>
<td>垂直居中</td>
<td></td>
</tr>
<tr>
<td>stretch</td>
<td>拉伸</td>
<td>需要去除拉伸方向的高度</td>
</tr>
</tbody></table>
<h4 id="align-content（多行）"><a href="#align-content（多行）" class="headerlink" title="align-content（多行）"></a>align-content（多行）</h4><blockquote>
<p>设置子项在侧轴上的排列顺序，并且只能用于子项出现换行的情况(多行)，在单行下是没有效果的。</p>
</blockquote>
<table>
<thead>
<tr>
<th>属性</th>
<th>说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>flex-start</td>
<td>从侧轴的头部开始</td>
<td>默认值</td>
</tr>
<tr>
<td>flex-end</td>
<td>从侧轴的尾部开始</td>
<td></td>
</tr>
<tr>
<td>center</td>
<td>从侧轴的中间显示</td>
<td></td>
</tr>
<tr>
<td>space-around</td>
<td>在想在侧轴平分剩余空间</td>
<td></td>
</tr>
<tr>
<td>space-between</td>
<td>子项在侧轴先分布在两边，在评分剩余空间</td>
<td></td>
</tr>
<tr>
<td>stretch</td>
<td>设置子项元素高度评分父元素高度</td>
<td></td>
</tr>
</tbody></table>
<h4 id="flex-flow"><a href="#flex-flow" class="headerlink" title="flex-flow"></a>flex-flow</h4><blockquote>
<p>此属性是flew-direction和flew-wrap属性的复合属性</p>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">父元素</span> <span class="token punctuation">&#123;</span>
    <span class="token property">flew-flow</span><span class="token punctuation">:</span>  row  wrap<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>



<h4 id="flex布局常见的子属性："><a href="#flex布局常见的子属性：" class="headerlink" title="flex布局常见的子属性："></a>flex布局常见的子属性：</h4><h4 id="1-flex-定义子元素剩余空间"><a href="#1-flex-定义子元素剩余空间" class="headerlink" title="1. flex  定义子元素剩余空间"></a>1. flex  定义子元素剩余空间</h4><blockquote>
<p>flex属性定义子项目分配剩余空间，子项目占有多少份。</p>
<p>默认分配的是主轴方向的份数。</p>
<p>可以写百分比。</p>
<p>可以在同一个父盒子中给多个子盒子分配不同的份额。</p>
<p>语法：</p>
<p>​        子盒子 {</p>
<p>​                flex：子盒子占父盒子剩余空间的份数。</p>
<p>​        }</p>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">父盒子</span> <span class="token punctuation">&#123;</span>
    <span class="token property">display</span><span class="token punctuation">:</span> flex<span class="token punctuation">;</span>       <span class="token comment">/*设置布局方式为弹性布局*/</span>
<span class="token punctuation">&#125;</span>

<span class="token selector">子盒子1</span> <span class="token punctuation">&#123;</span>
    flex：1；       <span class="token comment">/*占父盒子剩余空间的一份份额*/</span>
<span class="token punctuation">&#125;</span>

<span class="token selector">子盒子2</span> <span class="token punctuation">&#123;</span>
    flex：2；       <span class="token comment">/*占父盒子剩余空间的二份份额*/</span>
<span class="token punctuation">&#125;</span>

<span class="token selector">子盒子3</span> <span class="token punctuation">&#123;</span>
    flex：20%；       <span class="token comment">/*占父盒子剩余空间的20%*/</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h4 id="2-align-self-控制子项自己在侧轴上的排列方式"><a href="#2-align-self-控制子项自己在侧轴上的排列方式" class="headerlink" title="2. align-self 控制子项自己在侧轴上的排列方式"></a>2. align-self 控制子项自己在侧轴上的排列方式</h4><blockquote>
<p>align-self属性允许单个项目和其他项目不一样的对齐方式，可以覆盖align-items属性，默认值为auto，表示继承自元素的align-items属性，如果没有父元素，则等于stretch。</p>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">父盒子</span> <span class="token punctuation">&#123;</span>
    <span class="token property">display</span><span class="token punctuation">:</span> flex<span class="token punctuation">;</span>       <span class="token comment">/*设置布局方式为弹性布局*/</span>
<span class="token punctuation">&#125;</span>

<span class="token selector">子盒子</span> <span class="token punctuation">&#123;</span>
    <span class="token property">align-self</span><span class="token punctuation">:</span> flex-end；       <span class="token comment">/*设置 单独子元素侧轴的排列顺序*/</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h4 id="3-order-定义项目排列顺序"><a href="#3-order-定义项目排列顺序" class="headerlink" title="3.  order 定义项目排列顺序"></a>3.  order 定义项目排列顺序</h4><blockquote>
<p>数值越小,排列越靠前,默认为0;</p>
<p>注意: 和z-index属性相反.</p>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">父盒子</span> <span class="token punctuation">&#123;</span>
    <span class="token property">display</span><span class="token punctuation">:</span> flex<span class="token punctuation">;</span>       <span class="token comment">/*设置布局方式为弹性布局*/</span>
<span class="token punctuation">&#125;</span>

<span class="token selector">子盒子1</span> <span class="token punctuation">&#123;</span>
    <span class="token property">order</span><span class="token punctuation">:</span>1；       <span class="token comment">/*设置 单独子元素排列顺序-向后*/</span>
<span class="token punctuation">&#125;</span>

<span class="token selector">子盒子2</span> <span class="token punctuation">&#123;</span>
    <span class="token property">order</span><span class="token punctuation">:</span>-1；       <span class="token comment">/*设置 单独子元素排列顺序-提前*/</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h3 id="rem适配布局"><a href="#rem适配布局" class="headerlink" title="rem适配布局"></a>rem适配布局</h3><blockquote>
<p>可以使布局文字随着屏幕大小变化而变化。</p>
<p>可以跟随页面的大小变化改变高度。</p>
<p>可以让屏幕发生变化的时候元素高度和宽度等比例缩放。</p>
<p>实现原理：</p>
<p>​    设置页面的媒体查询 –》在媒体查询中设置html的字体大小</p>
<p>​    –》 设置宽度高度为rem单位   –》当改变屏幕宽度时，媒体查询改变，html的字体大小改变，页面rem单位相应改变。</p>
<p>技术方案1：</p>
<p>​             less  +   媒体查询   +  rem</p>
<p>技术方案2：</p>
<p>​                flexible.js  +  rem</p>
</blockquote>
<h4 id="em单位"><a href="#em单位" class="headerlink" title="em单位"></a>em单位</h4><blockquote>
<p><code>em</code>  相对长度单位，相对于当前对象的父元素内文本的字体尺寸。</p>
<p>父元素字体尺寸 =  em；</p>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">父元素</span> <span class="token punctuation">&#123;</span>
    <span class="token property">font-size</span><span class="token punctuation">:</span> 12px<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>

<span class="token selector">子元素</span> <span class="token punctuation">&#123;</span>
    <span class="token property">height</span><span class="token punctuation">:</span> 10em<span class="token punctuation">;</span>   <span class="token comment">/*设置子元素高度为父元素字体的 10 倍，即120px*/</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h4 id="rem单位"><a href="#rem单位" class="headerlink" title="rem单位"></a>rem单位</h4><blockquote>
<p>rem (root em)是一个相对单位。类似于<code>em</code>，<code>em</code>是父元素字体大小。</p>
<p>不同的是rem的基准是相对于html元素的字体大小。</p>
<p>html字体大小 =  1 rem；</p>
<ul>
<li>与父元素字体大小无关。</li>
</ul>
<p>优点：</p>
<p>​    可以通过修改html里面的文字大小来改变页面中元素的大小，可以整体控制。</p>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">html</span> <span class="token punctuation">&#123;</span>
    <span class="token property">font-size</span><span class="token punctuation">:</span> 12px<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>

<span class="token selector">子元素</span> <span class="token punctuation">&#123;</span>
    <span class="token property">height</span><span class="token punctuation">:</span> 10rem<span class="token punctuation">;</span>   <span class="token comment">/*设置子元素高度为html根元素字体的10倍，即10px*/</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h4 id="媒体查询"><a href="#媒体查询" class="headerlink" title="媒体查询"></a>媒体查询</h4><blockquote>
<p>媒体查询(media query) 是css3新语法。</p>
<p>使用@media查询，可以针对不同的媒体类型定义不同的样式。</p>
<p>@media可以针对不同的屏幕尺寸设置不同的样式。</p>
<p>​    重置浏览器大小的过程中，页面也会根据 浏览器的宽度和高度重新渲染页面。</p>
<p>准对手机，平板等设备使用较多的媒体查询。</p>
</blockquote>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token atrule"><span class="token rule">@media</span> mediatype <span class="token keyword">and</span>|<span class="token keyword">not</span>|<span class="token keyword">only</span> <span class="token punctuation">(</span>media feature<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    css-Code<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>

例子： 
<span class="token comment">/*当运行在屏幕，且屏幕最大宽度为800像素时(小于等于800px)，运行。*/</span>
<span class="token atrule"><span class="token rule">@media</span> screen <span class="token keyword">and</span> <span class="token punctuation">(</span>max-width：800px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">body</span> <span class="token punctuation">&#123;</span>
        <span class="token property">background-color</span><span class="token punctuation">:</span> green<span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token comment">/*多个并列属性--页面宽度大于800px且小于1000px*/</span>
<span class="token atrule"><span class="token rule">@media</span> screen <span class="token keyword">and</span> <span class="token punctuation">(</span>max-width：800px<span class="token punctuation">)</span>  <span class="token keyword">and</span> <span class="token punctuation">(</span>min-width：1000px<span class="token punctuation">)</span></span><span class="token punctuation">&#123;</span>
    <span class="token selector">body</span> <span class="token punctuation">&#123;</span>
        <span class="token property">background-color</span><span class="token punctuation">:</span> green<span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<ul>
<li>用@media开头 </li>
<li>mediatype 媒体类型</li>
<li>关键字 and not only</li>
<li>media feature 媒体特性必须小括号包含</li>
</ul>
<h4 id="mediatype-查询类型"><a href="#mediatype-查询类型" class="headerlink" title="mediatype 查询类型"></a>mediatype 查询类型</h4><blockquote>
<p>不同的终端设备划分成不同的类型，称为媒体类型。</p>
</blockquote>
<table>
<thead>
<tr>
<th>值</th>
<th>说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>all</td>
<td>用于所有设备</td>
<td></td>
</tr>
<tr>
<td>print</td>
<td>用于打印机和打印预览</td>
<td></td>
</tr>
<tr>
<td>screen</td>
<td>用于电脑屏幕，平板电脑，智能手机</td>
<td></td>
</tr>
</tbody></table>
<h4 id="关键字"><a href="#关键字" class="headerlink" title="关键字"></a>关键字</h4><blockquote>
<p>关键字将媒体类型或多个媒体特性连接到一起作为媒体查询的条件。</p>
<ul>
<li>and ：可以将多个媒体特性连接到一起，相当于’且’ 的意思。</li>
<li>not ： 排除某个指定的媒体类型，相当于’非’ 的意思。</li>
<li>only ：指定某人特定的媒体类型。可以省略。</li>
</ul>
</blockquote>
<h4 id="引入资源"><a href="#引入资源" class="headerlink" title="引入资源"></a>引入资源</h4><blockquote>
<p>​    媒体查询不仅可以单独修改某一个元素的样式表，还可以引入其他位置的样式表。实现在不同的宽度下，css样式表不同，来为一个页面两个宽度下做出较大的改变。</p>
<p>​    可以在引入样式表的link标签中添加媒体查询，来实现在不同媒体查询下引入不同的样式表。</p>
<p>（引入标签中的if语句）</p>
</blockquote>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token doctype"><span class="token punctuation">&lt;!</span><span class="token doctype-tag">DOCTYPE</span> <span class="token name">html</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>en<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">charset</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>UTF-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">http-equiv</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>X-UA-Compatible<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>IE=edge<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>viewport<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>width=device-width, initial-scale=1.0<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>stylesheet<span class="token punctuation">"</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>样式表1路径<span class="token punctuation">"</span></span> <span class="token attr-name">media</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>screen and (min-width: 320px)<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>stylesheet<span class="token punctuation">"</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>样式表2路径<span class="token punctuation">"</span></span> <span class="token attr-name">media</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>screen and　（min-width:640px）<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">></span></span>Document<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>section</span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>section</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">></span></span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h3 id="响应式布局"><a href="#响应式布局" class="headerlink" title="响应式布局"></a>响应式布局</h3><blockquote>
<p>​    使用媒体查询准对不同宽度的设备进行布局和样式的设置，从而适配不同设备的目的。</p>
<p>​    响应式需要一个父级作为布局容器，来配合子级元素来实现变化效果。原理：<br>​            通过媒体查询来改变这个布局容器的大小，再改变里面子元素的排列顺序和大小，从而实现不同屏幕下，看到不同页面布局和样式变化。</p>
</blockquote>
<table>
<thead>
<tr>
<th>设备划分</th>
<th>尺寸区间</th>
<th>设置宽度</th>
</tr>
</thead>
<tbody><tr>
<td>超小屏幕（手机）xs</td>
<td>&lt;768px</td>
<td>100%</td>
</tr>
<tr>
<td>小屏设备（平板）sm</td>
<td>&gt;=768px~&lt;992px</td>
<td>750px</td>
</tr>
<tr>
<td>中等屏幕（桌面显示器）md</td>
<td>&gt;=992px~&lt;1200px</td>
<td>970px</td>
</tr>
<tr>
<td>宽屏设备（大桌面显示器）lg</td>
<td>&gt;=1200px</td>
<td>1170px</td>
</tr>
</tbody></table>
<h4 id="布局样式"><a href="#布局样式" class="headerlink" title="布局样式"></a>布局样式</h4><pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token atrule"><span class="token rule">@media</span> screen <span class="token keyword">and</span><span class="token punctuation">(</span><span class="token property">min-width</span><span class="token punctuation">:</span> 767px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">.container</span> <span class="token punctuation">&#123;</span>
      <span class="token property">width</span><span class="token punctuation">:</span> 100%<span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule"><span class="token rule">@media</span> screen <span class="token keyword">and</span><span class="token punctuation">(</span><span class="token property">min-width</span><span class="token punctuation">:</span> 992px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
  <span class="token selector">.container</span> <span class="token punctuation">&#123;</span>
    <span class="token property">width</span><span class="token punctuation">:</span> 750px<span class="token punctuation">;</span>
  <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule"><span class="token rule">@media</span> screen <span class="token keyword">and</span><span class="token punctuation">(</span><span class="token property">min-width</span><span class="token punctuation">:</span> 992px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
  <span class="token selector">.container</span> <span class="token punctuation">&#123;</span>
    <span class="token property">width</span><span class="token punctuation">:</span> 970px<span class="token punctuation">;</span>
  <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule"><span class="token rule">@media</span> screen <span class="token keyword">and</span><span class="token punctuation">(</span><span class="token property">min-width</span><span class="token punctuation">:</span> 1200px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
  <span class="token selector">.container</span> <span class="token punctuation">&#123;</span>
    <span class="token property">width</span><span class="token punctuation">:</span> 1170px<span class="token punctuation">;</span>
  <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>





<h2 id="七-Less基础"><a href="#七-Less基础" class="headerlink" title="七. Less基础"></a>七. Less基础</h2><blockquote>
<p>css是一门非程序的语言，没有变量，没有函数，作用域等概念。</p>
<ul>
<li>css需要书写大量看似没有逻辑的代码，css冗余度是比较高的。</li>
<li>css没有很好的计算能力。</li>
<li>很难写出组织良好且易于维护的css代码项目。</li>
</ul>
</blockquote>
<h3 id="less介绍"><a href="#less介绍" class="headerlink" title="less介绍"></a>less介绍</h3><blockquote>
<p>Less(leaner Style Sheets) 是一门css的扩展语言，也是css的预处理器。</p>
<p>作为css的一种形式的扩展，它并没有减少css的功能，而是在现有的css语法上，为css加入程序式语言的特性。</p>
<p>在css的语法基础上引入了变量，mixin，运算以及函数等功能，大大简化css的编写，并且降低了css的维护成本，可以让我们用更少的代码做更多的事情。</p>
<p>新建一个后缀名为less的文件，并且在这个less文件里面书写less语句。</p>
<p><a target="_blank" rel="noopener" href="http://lesscss.cn/">官网</a></p>
</blockquote>
<h3 id="less导入"><a href="#less导入" class="headerlink" title="less导入"></a>less导入</h3><blockquote>
<p>less文件可以导入另一个less文件：</p>
<p>语法：</p>
<p>​        @import “less文件名”</p>
<p>可以减少html中的link标签的引入量。导入文件可以有扩展名，也可以没有扩展名。</p>
<p>引入的less文件和当前less文件会合并为一个css文件。</p>
</blockquote>
<pre class="line-numbers language-less" data-language="less"><code class="language-less"><span class="token variable">@import</span> “common”<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>





<h3 id="less变量"><a href="#less变量" class="headerlink" title="less变量"></a>less变量</h3><blockquote>
<p>变量是指没有固定的值，可以改变的。在css中的一些颜色和数值等经常使用。</p>
<p>语法：</p>
<p>​    @变量名：值；</p>
<ul>
<li>必须以@为前缀</li>
<li>不能包含特殊字符</li>
<li>不能以数字为开头</li>
<li>大小写敏感        </li>
</ul>
</blockquote>
<pre class="line-numbers language-less" data-language="less"><code class="language-less"><span class="token variable">@color<span class="token punctuation">:</span></span>  green<span class="token punctuation">;</span>

<span class="token selector">选择器</span> <span class="token punctuation">&#123;</span>
    <span class="token property">background-color</span><span class="token punctuation">:</span> <span class="token variable">@color</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<h3 id="less编译"><a href="#less编译" class="headerlink" title="less编译"></a>less编译</h3><blockquote>
<p>本质上，less包含一套自定义的语法及一个解析器，用户根据这些语法定义自己的样式规则，这些样式规则最终会通过解析器，编译生成对应的css文件。</p>
<p>编写less文件  –》保存less文件 –》 编译生成css文件 –》 使用css文件</p>
<ul>
<li>在vscode中安装Easy Less插件，使用less文件书写相应的代码，只要保存，就回来当前路径中产生一个同名的css样式文件。</li>
</ul>
</blockquote>
<h3 id="less嵌套"><a href="#less嵌套" class="headerlink" title="less嵌套"></a>less嵌套</h3><blockquote>
<p>可以在一个选择器中再嵌套另一个选择器，编译器会将less代码编译为正常的css代码形式</p>
</blockquote>
<p>less：</p>
<pre class="line-numbers language-less" data-language="less"><code class="language-less"><span class="token selector">div</span> <span class="token punctuation">&#123;</span>
    <span class="token selector">css属性；
    a</span> <span class="token punctuation">&#123;</span>
        css属性；
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p>css：</p>
<pre class="line-numbers language-css" data-language="css"><code class="language-css"><span class="token selector">div</span> <span class="token punctuation">&#123;</span>
    css属性；
<span class="token punctuation">&#125;</span>
<span class="token selector">div a</span> <span class="token punctuation">&#123;</span>
    css属性；
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p>伪类的书写形式：</p>
<pre class="line-numbers language-less" data-language="less"><code class="language-less"><span class="token selector">div</span> <span class="token punctuation">&#123;</span>
    <span class="token selector">css代码；
    &amp;:hove</span><span class="token punctuation">&#123;</span>      <span class="token comment">/*如果没有&amp;符号，将自动解析为父选择器的后代*/</span>
        		<span class="token comment">/*如果有&amp;符号，将自动解析为父选择器的自身，会泽和伪类*/</span>
        css代码；
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h3 id="less运算"><a href="#less运算" class="headerlink" title="less运算"></a>less运算</h3><blockquote>
<p>任何数字，颜色或者变量都可以参加运算，就是less提供了加(+</p>
<p>) ，减(-) ,乘(*) ,除(/)算数运算。</p>
<ul>
<li>运算符中间左右需要空格隔开 ： 1px + 5</li>
<li>对于两个不同的单位的值之间的运算，运算结果的值取第一个值的单位。</li>
<li>如果两个值之间只有一个值有单位，则运算结果就取该单位。</li>
</ul>
</blockquote>
<pre class="line-numbers language-less" data-language="less"><code class="language-less"><span class="token atrule">@font ：50px +5；

div</span> <span class="token punctuation">&#123;</span>
    <span class="token property">width</span><span class="token punctuation">:</span> 200px <span class="token operator">-</span>50<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>











<h1 id="bootstrap-框架"><a href="#bootstrap-框架" class="headerlink" title="bootstrap 框架"></a>bootstrap 框架</h1><blockquote>
<p>​    bootstrap 来自Twitter，是目前最受欢迎的前端框架。bootstrap是基于HTML，css和javascript的。简洁灵活，使得web开发更加快捷。</p>
<p>​    bootstrap 使用Normalize.css初始化，使用bootstrap框架时，不需要引入Normalize.css初始化。</p>
</blockquote>
<h2 id="1-框架"><a href="#1-框架" class="headerlink" title="1. 框架"></a>1. 框架</h2><blockquote>
<p>​    框架就是一套架构，有一套比较完整的网页功能解决方案，而且控制权在框架本身，有与之样式库，组件和插件。使用者要按照框架所规定的某种规范进行开发。</p>
</blockquote>
<h2 id="2-使用框架"><a href="#2-使用框架" class="headerlink" title="2. 使用框架"></a>2. 使用框架</h2><blockquote>
<p>使用框架的步骤：</p>
<ul>
<li>创建文件夹结构</li>
<li>创建html骨架结构</li>
<li>引入相关的样式文件</li>
<li>书写内容</li>
</ul>
</blockquote>
<h3 id="创建文件夹结构"><a href="#创建文件夹结构" class="headerlink" title="创建文件夹结构"></a>创建文件夹结构</h3><blockquote>
<p>先创建项目文件夹中的：</p>
<p>​        bootstrap  css js images 等文件夹</p>
<p>在bootstrap文件夹中复制：</p>
<p>​        css fonts js 文件夹</p>
</blockquote>
<p><img src="https://www.hualigs.cn/image/609fc71598a74.jpg"></p>
<h3 id="创建骨架结构"><a href="#创建骨架结构" class="headerlink" title="创建骨架结构"></a>创建骨架结构</h3><blockquote>
<p>将bootstrap的基础骨架引入到html文档中。</p>
</blockquote>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token doctype"><span class="token punctuation">&lt;!</span><span class="token doctype-tag">DOCTYPE</span> <span class="token name">html</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>en<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">charset</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>utf-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
      <span class="token comment">&lt;!-- 是浏览器以最高版本渲染 --></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">http-equiv</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>X-UA-Compatible<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>IE=edge<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
      <span class="token comment">&lt;!-- 视口设置：视口的宽度和设备一致，默认缩放比例和pc端一致，用户不能自行缩放 --></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>viewport<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>width=device-width, initial-scale=1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">></span></span>标题<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">></span></span>

    <span class="token comment">&lt;!-- Bootstrap --></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bootstrap/css/bootstrap.min.css<span class="token punctuation">"</span></span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>stylesheet<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>

    <span class="token comment">&lt;!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --></span>
    <span class="token comment">&lt;!-- WARNING: Respond.js doesn't work if you view the page via file:// --></span>
      <span class="token comment">&lt;!-- 解决ie9以下浏览器对新增标签不识别并导致css不起作用的问题 --></span>
    <span class="token comment">&lt;!--[if lt IE 9]>
      &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js">&lt;/script>
      &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js">&lt;/script>
    &lt;![endif]--></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span><span class="token punctuation">></span></span>Hello, world!<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">></span></span>

    <span class="token comment">&lt;!-- jQuery (necessary for Bootstrap's JavaScript plugins) --></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://code.jquery.com/jquery-1.11.2.min.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">></span></span>
    <span class="token comment">&lt;!-- Include all compiled plugins (below), or include individual files as needed --></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>js/bootstrap.min.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h3 id="引入相关样式文件"><a href="#引入相关样式文件" class="headerlink" title="引入相关样式文件"></a>引入相关样式文件</h3><blockquote>
<p>向骨架中导入相关的样式文件。(注意处理路径问题)</p>
<p>​    &lt;link href=”路径” rel=”stylesheet”&gt;</p>
</blockquote>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bootstrap/css/bootstrap.min.css<span class="token punctuation">"</span></span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>stylesheet<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>





<h3 id="书写内容"><a href="#书写内容" class="headerlink" title="书写内容"></a>书写内容</h3><blockquote>
<p>向骨架结构中填充符合框架使用规则的组件</p>
</blockquote>
<h2 id="3-布局容器"><a href="#3-布局容器" class="headerlink" title="3 布局容器"></a>3 布局容器</h2><blockquote>
<p>​    bootstrap需要为页面内容和栅格系统包裹一个 .container 容器，bootstrap预先定义好了这个类，叫  .container </p>
<p>使用这些类，就不需要自己定义媒体查询，直接使用就可以了。</p>
</blockquote>
<h3 id="container类"><a href="#container类" class="headerlink" title="container类"></a>container类</h3><blockquote>
<ul>
<li>响应式布局容器，固定宽度。</li>
<li>大屏(&gt;=1200px) 宽度定位1170px。</li>
<li>中屏(&gt;=992px) 宽度定位970px。</li>
<li>小屏(&gt;=768px) 宽度定位750px。</li>
<li>超小屏(100%)。</li>
</ul>
</blockquote>
<h3 id="container-fluid类"><a href="#container-fluid类" class="headerlink" title="container-fluid类"></a>container-fluid类</h3><blockquote>
<ul>
<li>流式布局容器 百分百宽度。</li>
<li>占据全部视口(viewport)的容器。</li>
<li>适合于单独做移动端开发。</li>
</ul>
</blockquote>
<h2 id="4-栅格系统"><a href="#4-栅格系统" class="headerlink" title="4. 栅格系统"></a>4. 栅格系统</h2><blockquote>
<p>​    栅格系统(grid systems),可有人翻译为“网格系统”，它是指将也买你布局划分为等宽的列，然后通过列数的定义来模块化页面布局。</p>
<p>bootstrap 提供了一套响应式，移动设备优先的流式栅格系统，随着屏幕或者视口的尺寸的增加，系统会自动分为最多12列。</p>
<p>bootstrap里面container宽度式固定的，但是不同屏幕下，container的宽度不同，将container划分为12等份。</p>
</blockquote>
<h3 id="栅格系统参数"><a href="#栅格系统参数" class="headerlink" title="栅格系统参数"></a>栅格系统参数</h3><blockquote>
<p>栅格系统通过一系列的行(row) 和列(column) 来组合常见页面布局。</p>
</blockquote>
<table>
<thead>
<tr>
<th></th>
<th>超小屏幕(&lt;768px)</th>
<th>小屏(&gt;=768px)</th>
<th>中等屏(&gt;=992px)</th>
<th>宽屏(&gt;=1200px)</th>
</tr>
</thead>
<tbody><tr>
<td>.container</td>
<td>自动(100%)</td>
<td>750px</td>
<td>970px</td>
<td>1170px</td>
</tr>
<tr>
<td>类前缀</td>
<td>.col-xs-</td>
<td>.col-sm-</td>
<td>.col-md-</td>
<td>-col-lg-</td>
</tr>
<tr>
<td>列数(column)</td>
<td>12</td>
<td>12</td>
<td>12</td>
<td>12</td>
</tr>
</tbody></table>
<ul>
<li><p>行（row）必须放到container布局容器里面。</p>
</li>
<li><p>实现列的平均划分需要给列添加类前缀。</p>
</li>
<li><p>xs-extra small：超小 ； sm-small：小；md-medium：中等；lg-large：大；</p>
</li>
<li><p>列(column)大于12.多余的 “列(column)”所在的元素将被作为一个整体另起一行排列。</p>
</li>
<li><p>每一列默认有左右15像素的padding。</p>
</li>
<li><p>可以同时为一列指定多个是设备的类名。以便划分不同份数：</p>
<ul>
<li><p>class=”col-md-4 col-sm-6”</p>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token comment">&lt;!--设置当前组件在大屏幕下占3份额，在中屏幕下占4份额，在小屏幕中占6份额，在超小屏幕下占12份额--></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-3 col-md-4 col-sm-6 col-xs-12<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre></li>
</ul>
</li>
</ul>
<blockquote>
<p>如果份数相加大于定义的总份额，多余的将会被挤到下一行显示。</p>
<p>如果份数相加小于定义的总份额，会占不满整个的container，会有空白。</p>
</blockquote>
<p>i</p>
<h3 id="列嵌套"><a href="#列嵌套" class="headerlink" title="列嵌套"></a>列嵌套</h3><blockquote>
<p>​    栅格系统内置的栅格系统将内容再次嵌套。就是一个列再次分为若干个小列，可以添加一个新的 <code>.row元素 </code>和一系列的 <code>.col-sm-*元素</code> 到 <code>.col-sm-*元素</code> 中。</p>
<ul>
<li>列嵌套最好加一个<code>row</code>行元素，可以取消父元素的padding值而且高度自动和父级一样高。</li>
</ul>
</blockquote>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token comment">&lt;!-- 容器--></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token comment">&lt;!-- 行--></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>row<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
            	<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>row<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
          			<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>ii<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
          			<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>ii<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
          			<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>ii<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
        	     <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>ll<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>ll<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h3 id="列偏移"><a href="#列偏移" class="headerlink" title="列偏移"></a>列偏移</h3><blockquote>
<p>可以使用 <code>.col-md-offset-* </code>类 使得列向右侧偏移。</p>
<p>实际是通过*选择器为当前元素增加了左边的边距(margin)。</p>
<p>语法： </p>
<p>​        .col-md-offset-偏移的份数；</p>
</blockquote>
<p><img src="https://www.hualigs.cn/image/60a10605a5c18.jpg"></p>
<p>​                                其实就是为右侧盒子增加左边距</p>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token comment">&lt;!--设置左侧四份，右侧四份，中间偏移四份--></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>row<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>左侧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4 col-lg-offset-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>右侧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>       
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>row<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
        <span class="token comment">&lt;!--设置四份，并且向右偏移四份，居中对齐--></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4 col-lg-offset-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>中间<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>       
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h3 id="列排序"><a href="#列排序" class="headerlink" title="列排序"></a>列排序</h3><blockquote>
<p>通过使用 <code>.col-md-push-*</code> 和 <code>.col-md-pull-*</code>类 就可以改变列(column)的顺序。</p>
<p>语法：</p>
<p>​        .col-md-push-份数;     //向右推指定的份额</p>
<p>​        .col-md-pull-份数;        //向左拉指定的份额</p>
</blockquote>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>row<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
        <span class="token comment">&lt;!--使用push和pull实现位置的交换--></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4 col-lg-push-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>左<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4 col-lg-pull-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>右<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>





<h3 id="响应式工具"><a href="#响应式工具" class="headerlink" title="响应式工具"></a>响应式工具</h3><blockquote>
<p>​    为了加快对移动设备页面开发工作，利用媒体查询功能，使用这些工具类可以方便的针对设备的不同尺寸来设置组件的展示或者隐藏。</p>
<p>语法：</p>
<p>​        .hidden-xs;</p>
</blockquote>
<table>
<thead>
<tr>
<th>类名</th>
<th>超小屏</th>
<th>小屏</th>
<th>中屏</th>
<th>大屏</th>
</tr>
</thead>
<tbody><tr>
<td>.hidden-xs</td>
<td>隐藏</td>
<td>可见</td>
<td>可见</td>
<td>可见</td>
</tr>
<tr>
<td>.hidden-sm</td>
<td>可见</td>
<td>隐藏</td>
<td>可见</td>
<td>可见</td>
</tr>
<tr>
<td>.hidden-md</td>
<td>可见</td>
<td>可见</td>
<td>隐藏</td>
<td>可见</td>
</tr>
<tr>
<td>.hidden-lg</td>
<td>可见</td>
<td>可见</td>
<td>可见</td>
<td>隐藏</td>
</tr>
</tbody></table>
<pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
     <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>row<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
         <span class="token comment">&lt;!--在中屏幕下隐藏--></span>
      	<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>col-lg-4  hidden-md<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>ll<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
     <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<blockquote>
<p>与之相反的是:</p>
<ul>
<li>visible-xs</li>
<li>visible-sm</li>
<li>visible-md</li>
<li>visible-lg            在某个屏幕下显示某个组件。</li>
</ul>
</blockquote>
<h1 id="移动端开发导入基础"><a href="#移动端开发导入基础" class="headerlink" title="移动端开发导入基础"></a>移动端开发导入基础</h1><h2 id="1-建立相应的文件夹"><a href="#1-建立相应的文件夹" class="headerlink" title="1.建立相应的文件夹"></a>1.建立相应的文件夹</h2><blockquote>
<ul>
<li>相应index.html文件</li>
<li>css文件夹</li>
<li>images文件夹</li>
</ul>
</blockquote>
<h2 id="2-向css文件夹中导入基础的样式表"><a href="#2-向css文件夹中导入基础的样式表" class="headerlink" title="2.向css文件夹中导入基础的样式表"></a>2.向css文件夹中导入基础的样式表</h2><blockquote>
<ul>
<li>导入基础样式表</li>
<li>导入normalize.css</li>
<li>设置common.less文件</li>
</ul>
</blockquote>
<pre class="line-numbers language-less" data-language="less"><code class="language-less">
<span class="token selector">html</span> <span class="token punctuation">&#123;</span>
    <span class="token property">font-size</span><span class="token punctuation">:</span> 50px<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>

<span class="token variable">@no<span class="token punctuation">:</span></span> 15<span class="token punctuation">;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>320px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 320px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>360px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 360px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>375px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 375px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>384px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 384px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>400px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 400px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>414px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 414px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>424px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 424px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>480px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 480px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>540px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 540px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>720px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 720px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>

<span class="token atrule">@media screen and <span class="token punctuation">(</span>min-width<span class="token punctuation">:</span>750px<span class="token punctuation">)</span></span> <span class="token punctuation">&#123;</span>
    <span class="token selector">html</span> <span class="token punctuation">&#123;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 750px <span class="token operator">/</span> <span class="token variable">@no</span><span class="token punctuation">;</span>
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>







<h2 id="3-为css基础样式表导入link标签"><a href="#3-为css基础样式表导入link标签" class="headerlink" title="3.为css基础样式表导入link标签"></a>3.为css基础样式表导入link标签</h2><pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>stylesheet<span class="token punctuation">"</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>css/normalize.css<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>



<h3 id="4-为js文件导入script标签"><a href="#4-为js文件导入script标签" class="headerlink" title="4.为js文件导入script标签"></a>4.为js文件导入script标签</h3><pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>js/js文件.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>



<h2 id="5-设置视图meta标签"><a href="#5-设置视图meta标签" class="headerlink" title="5.设置视图meta标签"></a>5.设置视图meta标签</h2><pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>viewport<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>width=device-width, initial-scale=1.0,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>














                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        Author:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/about" rel="external nofollow noreferrer">凡诚</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        Link:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://example.com/2021/11/08/yi-dong-duan-ji-chu/">http://example.com/2021/11/08/yi-dong-duan-ji-chu/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        Reprint policy:
                    </i>
                </span>
                <span class="reprint-info">
                    All articles in this blog are used except for special statements
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    reprint polocy. If reproduced, please indicate source
                    <a href="/about" target="_blank">凡诚</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>Copied successfully, please follow the reprint policy of this article</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">more</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/html/">
                                    <span class="chip bg-color">html</span>
                                </a>
                            
                                <a href="/tags/%E7%A7%BB%E5%8A%A8%E7%AB%AF/">
                                    <span class="chip bg-color">移动端</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    
    <div class="livere-card card" data-aos="fade-up">
    <!-- 来必力City版安装代码 -->
    <div id="lv-container" class="card-content" data-id="city" data-uid="MTAyMC81NzU4NC8zNDA0OA==">
        <script type="text/javascript">
            (function (d, s) {
                let j, e = d.getElementsByTagName(s)[0];
                if (typeof LivereTower === 'function') {
                    return;
                }

                j = d.createElement(s);
                j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
                j.async = true;

                e.parentNode.insertBefore(j, e);
            })(document, 'script');
        </script>
        <noscript>为正常使用来必力评论功能请激活JavaScript。</noscript>
    </div>
    <!-- City版安装代码已完成 -->
</div>
    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;Previous</div>
            <div class="card">
                <a href="/2021/11/08/csharp/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/2.jpg" class="responsive-img" alt="C#">
                        
                        <span class="card-title">C#</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            C#是微软公司发布的一种由C和C++衍生出来的面向对象的编程语言、运行于.NET Framework和.NET Core(完全开源，跨平台)之上的高级程序设计语言。
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2021-11-08
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E5%90%8E%E7%AB%AF%E6%8A%80%E6%9C%AF/" class="post-category">
                                    后端技术
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/C/">
                        <span class="chip bg-color">C#</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                Next&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2021/11/08/web-ji-chu/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/3.jpg" class="responsive-img" alt="html基础">
                        
                        <span class="card-title">html基础</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            Markdown 是一种轻量级标记语言，它允许人们使用易读易写的纯文本格式编写文档。
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2021-11-08
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E5%89%8D%E7%AB%AF%E6%8A%80%E6%9C%AF/" class="post-category">
                                    前端技术
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/html/">
                        <span class="chip bg-color">html</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;TOC</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        font-size: 15px;
        color: blue;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="2477330090"
                   fixed='true'
                   autoplay='false'
                   theme='blue'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 15px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2022</span>
            
            <span id="year">2022</span>
            <a href="/about" target="_blank">凡诚</a>
            &nbsp;&nbsp;<a href="https://hexo.io/" target="_blank"></a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">607.1k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <span id="sitetime">载入运行时间...</span>
            <script>
                function siteTime() {
                    var seconds = 1000;
                    var minutes = seconds * 60;
                    var hours = minutes * 60;
                    var days = hours * 24;
                    var years = days * 365;
                    var today = new Date();
                    var startYear = "2022";
                    var startMonth = "11";
                    var startDate = "7";
                    var startHour = "0";
                    var startMinute = "0";
                    var startSecond = "0";
                    var todayYear = today.getFullYear();
                    var todayMonth = today.getMonth() + 1;
                    var todayDate = today.getDate();
                    var todayHour = today.getHours();
                    var todayMinute = today.getMinutes();
                    var todaySecond = today.getSeconds();
                    var t1 = Date.UTC(startYear, startMonth, startDate, startHour, startMinute, startSecond);
                    var t2 = Date.UTC(todayYear, todayMonth, todayDate, todayHour, todayMinute, todaySecond);
                    var diff = t2 - t1;
                    var diffYears = Math.floor(diff / years);
                    var diffDays = Math.floor((diff / days) - diffYears * 365);
                    var diffHours = Math.floor((diff - (diffYears * 365 + diffDays) * days) / hours);
                    var diffMinutes = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours) /
                        minutes);
                    var diffSeconds = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours -
                        diffMinutes * minutes) / seconds);
                    if (startYear == todayYear) {
                        document.getElementById("year").innerHTML = todayYear;
                        document.getElementById("sitetime").innerHTML = "本站已安全运行 " + diffDays + " 天 " + diffHours +
                            " 小时 " + diffMinutes + " 分钟 " + diffSeconds + " 秒";
                    } else {
                        document.getElementById("year").innerHTML = startYear + " - " + todayYear;
                        document.getElementById("sitetime").innerHTML = "本站已安全运行 " + diffYears + " 年 " + diffDays +
                            " 天 " + diffHours + " 小时 " + diffMinutes + " 分钟 " + diffSeconds + " 秒";
                    }
                }
                setInterval(siteTime, 1000);
            </script>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/fanshicheng" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:2639144944@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2639144944" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 2639144944" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;Search</span>
            <input type="search" id="searchInput" name="s" placeholder="Please enter a search keyword"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>

    <script type="text/javascript">
        var OriginTitile=document.title,st;
        document.addEventListener("visibilitychange",function(){
            document.hidden?(document.title="(Ő∀Ő3)ノ",clearTimeout(st)):(document.title="ヽ(●-`Д´-)ノ欢迎回来",st=setTimeout(function(){document.title=OriginTitile},3e3))
        })
    </script>
    <!-- <script src="/js/cursor.js"></script> -->
    <script type="text/javascript">
        //只在桌面版网页启用特效
        var windowWidth = $(window).width();
        if (windowWidth > 768) {
            document.write('<script type="text/javascript" src="/js/sakura.js"><\/script>');
        }
        </script>
    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    
    <script>
        (function (i, s, o, g, r, a, m) {
            i["DaoVoiceObject"] = r;
            i[r] = i[r] || function () {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date();
            a = s.createElement(o), m = s.getElementsByTagName(o)[0];
            a.async = 1;
            a.src = g;
            a.charset = "utf-8";
            m.parentNode.insertBefore(a, m)
        })(window, document, "script", ('https:' == document.location.protocol ? 'https:' : 'http:') +
            "//widget.daovoice.io/widget/6984b559.js", "daovoice")
        daovoice('init', {
            app_id: "377cb7de"
        });
        daovoice('update');
    </script>
    

	
    
    <script type="text/javascript" color="0,0,255"
        pointColor="0,0,255" opacity='0.7'
        zIndex="-1" count="99"
        src="/libs/background/canvas-nest.js"></script>
    

    

    

    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    
    <!-- 冒泡 -->
    
<canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;" ></canvas> 
<script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script> 
<script type="text/javascript" src="/js/fireworks.js"></script>


</body>

</html>
